package thread.java20230106;

import java.util.Timer;
import java.util.TimerTask;

public class Demo40 {
    public static void main(String[] args) {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello timer 2");
            }
        },3000);

        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello timer  3");
            }
        },5000);

        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("hello timer  1");
            }
        },1000);
    }
}
